.popup-header {
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333333;
  font-size: 0.7rem;
  text-align: center;
  font-weight: bold;
  .close-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    color: #999;
  }
}

.popup-fade-enter-active {
  animation: cj-fade-in;
}

.popup-fade-leave-active {
  animation: cj-fade-out;
}

.popup-slide {
  &-center-enter-active {
    animation: cj-fade-in;
  }

  &-center-leave-active {
    animation: cj-fade-out;
  }

  &-top-enter,
  &-top-leave-active {
    transform: translate(0, -100%);
  }

  &-right-enter,
  &-right-leave-active {
    transform: translate(100%, 0);
  }

  &-bottom-enter,
  &-bottom-leave-active {
    transform: translate(0, 100%);
  }

  &-left-enter,
  &-left-leave-active {
    transform: translate(-100%, 0);
  }
}

.popup-box {
  position: fixed;
  max-height: 100%;
  overflow-y: auto;
  transition: transform 0.3s;
  -webkit-overflow-scrolling: touch;
  &.popup-close-bottom-center {
    padding-bottom: 50px;
    background-color: transparent;
  }
  &.has-title {
    display: flex;
    flex-direction: column;
    .close-top-right {
      padding: 0.75rem 0.5rem 0.3rem;
    }
  }
  &.popup-default-bg {
    background: #fff;
  }
}
.popup-body {
  flex: 1;
  overflow-y: scroll;
}

.popup-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 85%;

  &.round {
    border-radius: 0.5rem;
  }
}

.popup-bottom {
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85%;

  &.round {
    border-radius: 0.5rem 0.5rem 0 0;
  }
}

.popup-right {
  top: 0;
  right: 0;
  bottom: 0;

  &.round {
    border-radius: 10px 0 0 10px;
  }
}

.popup-left {
  top: 0;
  left: 0;
  bottom: 0;

  &.round {
    border-radius: 0 10px 10px 0;
  }
}

.popup-top {
  top: 0;
  left: 0;
  width: 100%;

  &.round {
    border-radius: 0 0 10px 10px;
  }
}

@keyframes cj-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cj-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.cj-overflow-hidden {
  overflow: hidden !important;
}

.popup-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

@keyframes cj-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cj-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.popup-close-icon {
  position: absolute;
  color: #ccc;

  &.close-bottom-center {
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0);
    color: #fff;
    font-size: 28px;
  }

  &.close-top-right {
    right: 0;
    top: 0;
    font-size: 0.6rem;
    color: #ccc;
    padding: 0.5rem;
  }
}

@media (min-width: 640px) {
  .popup-box {
    &.popup-center{
      max-width: 16rem;
    }
    &.popup-bottom {
      max-width: 16rem;
      left: 50%;
      margin-left: -8rem;
    }
  }
}
